#define _CRT_SECURE_NO_WARNINGS 1
#include "Sort.h"
#include "Stack.h"

void Print_arr(int* arr, int sz)
{
	for (int i = 0; i < sz; i++)
	{
		printf("%d ", arr[i]);
	}
}

void Sorttest()
{
	int arr[] = { 5, 3, 9, 6, 2, 4, 7, 1, 8 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	//QuickSort(arr,0,sz-1);
	//Print_arr(arr, sz);
	//QuickSortNonR(arr, 0, sz - 1);
	//Print_arr(arr, sz);
	MergeSort(arr, sz);
	Print_arr(arr, sz);
}

void STtest()
{
	ST st;
	STInit(&st);
	STPush(&st,2);
	STPush(&st,1);
	STPush(&st,5);
	STPush(&st,0);
	STPush(&st,6);
	while (!STEmpty(&st))
	{
		printf("%d ", StackTop(&st));
		STPop(&st);
	}
	STDstroy(&st);
}

void Half()
{
	int a = 0;
	int b = 0;
	scanf("%d %d", &a, &b);
	printf("%d\n", a + (a + b) / 2);
}

int main()
{
	Sorttest();
	//STtest();
	//Half();
	return 0;
}
